/*
============================================================================
 Name        : LastFmPlayer.cpp
 Author      : 
 Version     :
 Copyright   : Your copyright notice
 Description : CLastFmPlayer implementation
============================================================================
*/

#include "LastFmPlayer.h"
#include "StreamReader.h"
#include "StreamWriter.h"


CLastFmPlayer::CLastFmPlayer(MStreamBufferObserver& aObserver)
: iObserver(aObserver)
{
}

CLastFmPlayer::~CLastFmPlayer()
{
}

CLastFmPlayer* CLastFmPlayer::NewLC(MStreamBufferObserver& aObserver)
{
	CLastFmPlayer* self = new (ELeave)CLastFmPlayer(aObserver);
	CleanupStack::PushL(self);
	self->ConstructL();
	return self;
}

CLastFmPlayer* CLastFmPlayer::NewL(MStreamBufferObserver& aObserver)
{
	CLastFmPlayer* self = CLastFmPlayer::NewLC(aObserver);
	CleanupStack::Pop(); // self;
	return self;
}

void CLastFmPlayer::ConstructL()
{
	//Base construction
	CStreamPlayer::ConstructL();

	//Create reader and writer
	SetReaderL(CStreamReader::NewL());
	SetWriterL(CStreamWriter::NewL(iObserver));
}

